<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>设置 RSA 证书</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="oauth.setrequestengine.html">OAuth::setRequestEngine</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="oauth.setsslchecks.html">OAuth::setSSLChecks</a></div>
 <div class="up"><a href="class.oauth.html">OAuth</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="oauth.setrsacertificate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">OAuth::setRSACertificate</h1>
  <p class="verinfo">(PECL OAuth &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">OAuth::setRSACertificate</span> &mdash; <span class="dc-title">设置 RSA 证书</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-oauth.setrsacertificate-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><strong>OAuth::setRSACertificate</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$cert</code></span>
   )</div>

  <p class="para rdfs-comment">
   设置 <acronym>RSA</acronym> 证书。
  </p>

  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">本函数还未编写文档，仅有参数列表。</p></div>

 </div>


 <div class="refsect1 parameters" id="refsect1-oauth.setrsacertificate-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">cert</code></em></dt>

    <dd>

     <p class="para">
      <acronym>RSA</acronym> 证书。
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-oauth.setrsacertificate-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功则返回 <strong><code>TRUE</code></strong> ，失败返回 <strong><code>FALSE</code></strong> （例如，RSA证书不能被传递）。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-oauth.setrsacertificate-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>1.0.0</td>
       <td>
        以前失败时返回 <strong><code>NULL</code></strong>，而不是 <strong><code>FALSE</code></strong>。
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-oauth.setrsacertificate-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="oauth.setrsacertificate.example">
   <p><strong>Example #1 一个 <span class="methodname"><strong>OAuth::setRsaCertificate()</strong></span> 例子</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$consume&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">OAuth</span><span style="color: #007700">(</span><span style="color: #DD0000">'1234'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">OAUTH_SIG_METHOD_RSASHA1</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$consume</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setRSACertificate</span><span style="color: #007700">(</span><span style="color: #0000BB">file_get_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">'test.pem'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-oauth.setrsacertificate-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="methodname"><a href="oauth.setcapath.html" class="methodname" rel="rdfs-seeAlso">OAuth::setCaPath()</a> - 设置 CA 路径和信息</span></li>
  </ul>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="oauth.setrequestengine.html">OAuth::setRequestEngine</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="oauth.setsslchecks.html">OAuth::setSSLChecks</a></div>
 <div class="up"><a href="class.oauth.html">OAuth</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
